package com.lz.bos.dao.impl;

import java.util.List;

import com.lz.bos.dao.UserDao;
import com.lz.bos.dao.base.impl.BaseDaoImpl;
import com.lz.bos.domain.User;

public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

	public User findByUsernameAndPassword(String username, String password) {
		String hql = "FROM User u WHERE u.username = ? AND u.password = ?";
		List<User> list = (List<User>) this.getHibernateTemplate().find(hql, username, password);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

}
